import ajax from "./ajax"


class Http{
    constructor(){
        this.host = "http://127.0.0.1:7070"
    }

    loginRedisConsole(data,eventName){
        ajax.post("/redis/connect",data,eventName)
    }

    redisKeys(data,eventName){
        ajax.post("/redis/query?uuid="+data.token+"&query="+data.query,null,eventName);
    }

    redisKeyDetail(data,eventName){
        ajax.post("/redis/detail?uuid="+data.token+"&key="+data.key,null,eventName);
    }

    redisKeyDetailAndSerialize(data,eventName){
        ajax.post(data.host,null,eventName);
    }

    redisCmdLine(data,eventName){
        ajax.post("/redis/cmd",data,eventName);
    }
}

let http = new Http();

export default http;